<?php
/**
 * index 入口程序
 *
 * @copyright Copyright © 2009 harry
 * @author harry 
 * @subpackage room
 * 
 */
class admin_AdminAbstract extends FLEA_Controller_Action
{
	/**
     * current controller
	 */
	var $controller;

	/**
     * current action
	 */
	var $action;

	var $user; 
	/**
	 *
	 * @return object
	 */
	function __construct(){
		load_language('utf8');
		// 载入公共函数包
		//FLEA::loadFile('function');
		$this->smarty =& $this->_getView();
		$this->controller = strtolower(FLEA::getAppInf('FLEA.internal.currentControllerName'));
		$this->action = strtolower(FLEA::getAppInf('FLEA.internal.currentActionName'));
		$this->smarty->assign(array(
			'ctrl' => $this->controller,
			'act'  => $this->action,
		));
		$this->requirelogin();
		
	}

	function requirelogin(){
		$rbac =& FLEA::getSingleton('FLEA_Com_RBAC');
		$userData = $rbac->getUser();

		//获取登陆信息
		$this->user = $userData;
/*
		if(empty($userData) || !is_numeric($userData['admin_id'])){
			if($this->action!='login')
			{
				redirect(url('Default','login'));
				exit;
			}
		}*/
	}
}
